<template>
  <div id='DetailRate'>
    <div class="discuss">
      <span>用户评论</span>
      <a href="javascript:;">更多</a>
    </div>
    <div v-if="Object.keys(rate).length !== 0 ">
      <div>{{rate.user.uname}}</div>
      <div class="data">{{showData()}}</div>
    </div>
    <div v-else>暂无评论！！</div>

  </div>

</template>

<script>
  import { formatDate } from 'common/utils.js'
  export default {
    name: 'DetailRate',
    data() {
      return {

      }
    },
    props: {
      rate: {
        type: Object,
        default() {
        }
      }
    },
    mounted() {
      // console.log(this.rate);
    },
    components: {},
    methods: {
      showData() {
        const date = new Date(this.rate.created * 1000)
        return formatDate(date, 'yyyy-MM-dd')
      },

    }
  }
</script>

<style scoped>
  .discuss {
    width: 100%;
    margin: 20px 0;
  }

  .discuss a {
    float: right;
  }
</style>